<?php
namespace AdminApi\Controller;
use Zend\Mvc\Controller\AbstractRestfulController;
use Zend\View\Model\JsonModel;
class ComplaintsApiController extends AbstractRestfulController
{
    public function getList()
    {
		header('Access-Control-Allow-Origin: *');
		$userMedicineOrderTable=$this->getServiceLocator()->get('Models\Model\ComplaintsFactory');
		$renewedOrders = $userMedicineOrderTable->getAllComplaints()->toArray();
		if(count($renewedOrders)!=0){
				return new JsonModel(array(
					'value'			=>	1,
					'renewedOrders'		=> json_encode($renewedOrders),
				));
			}else{
				return new JsonModel(array(
					'value'			=>	0,
					'renewedOrders'		=> 	'Orders list is empty',
				));
			}
    }
    public function get($id)
    {	
		
    }
    public function create($oder)
    {
		
    }
    public function update($order_id,$order)
    {
		
	}
		
    public function delete($id)
    {
       
    }
}